package it.uniroma3.gaia.sama.schemaExchangeGenerator;

import it.uniroma3.gaia.sama.DataExchange;
import it.uniroma3.gaia.sama.SchemaExchange;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class VerifyCorrectnessStruct implements Iterable<VerifyCorrectnessResult> {
	private List<VerifyCorrectnessResult> results;
	private DataExchange mainDataExchange;
	
	
	public VerifyCorrectnessStruct() {
		this.results = new LinkedList<VerifyCorrectnessResult>();
	}

	public void setResults(List<VerifyCorrectnessResult> results) {
		this.results = results;
	}
	
	public List<VerifyCorrectnessResult> getResults() {
		return results;
	}
	
	public VerifyCorrectnessResult newVerifyCorrectnessResult(SchemaExchange schemaExchange,DataExchange dataExchange,OmomorphismResultEnum correct){
		VerifyCorrectnessResult result = new VerifyCorrectnessResult( schemaExchange, dataExchange, correct);
		this.results.add(result);
		return result;
	}
	
	public void addVerifyCorrectnessResult(VerifyCorrectnessResult res){
		this.results.add(res);
	}

	public void setMainDataExchange(DataExchange mainDataExchange) {
		this.mainDataExchange = mainDataExchange;
	}

	public DataExchange getMainDataExchange() {
		return mainDataExchange;
	}

	@Override
	public Iterator<VerifyCorrectnessResult> iterator() {
		return this.results.iterator();
	}
}
